﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace DataAccess {
    public class BrokerRepository : DataProvider {
        public DataTable getBroker() {
            String sql = "SELECT * FROM Brokers";
            return this.executeQueryDataTable(sql);
        }

        public int update(String name, String info, String wsName, String linkWS, String pvdID, String pvdPwd, String creditCardNumber) {
            String sql = "UPDATE Brokers SET BrokerName = '{0}', BrokerInfo = '{1}', WSName = '{2}', LinkWS = '{3}', PvdID = '{4}', PvdPwd = '{5}', PvdCreditCardNumber = '{6}' WHERE BrokerID = 1";
            sql = string.Format(sql, name, info, wsName, linkWS, pvdID, pvdPwd, creditCardNumber);

            return this.executeQuery(sql);
        }
    }
}
